package com.aviator.detective.script.aviator;

import com.aviator.detective.script.method.ArrayContainsMethod;
import com.aviator.detective.script.method.CurrentTimeMethod;
import com.googlecode.aviator.AviatorEvaluator;
import com.googlecode.aviator.AviatorEvaluatorInstance;

import java.util.Map;

public class DefaultAviatorScriptExecute extends AbstractAviatorScriptExecute{

    static final AviatorEvaluatorInstance instance = AviatorEvaluator.getInstance();

    static {
        instance.addFunction(new ArrayContainsMethod());
        instance.addFunction(new CurrentTimeMethod());
        //instance.setOption(Options.FEATURE_SET,Feature.getFullFeatures());
        instance.useLRUExpressionCache(1000);
    }
    public DefaultAviatorScriptExecute(Map<String,Object> paramContext){
        super(paramContext);
    }
    @Override
    public AviatorEvaluatorInstance init() {
        return instance;
    }
}
